package com.uzhie.exception;

import com.uzhie.web.bean.ErrorBean;

/**
 * 用户操作自定义错误
 * Created by lilongfei on 2018/7/12.
 */
public class EquipmentException extends BussException {
    private int status = -1;
    private String message;

    public EquipmentException(String error) {
        this(0, error);
    }

    public EquipmentException(int status, String error) {
        super(error);
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public ErrorBean getError(){
        ErrorBean error = new ErrorBean();
        error.setCode(status);
        error.setMsg(getMessage());
        return error;
    }

    public class Status {
        public final static String INSERT_ERROR = "添加设备信息错误,请查看sim卡号等关键信息是否重复";
        public final static String UPDATA_ERROR = "设备信息更新失败";
        public final static String DELETE_MENU_ERROR = "设备信息删除失败";
        public final static String UPDATA_STATUS_ERROR = "设备信息状态更新失败";
        public final static String ID_ISNULL = "设备ID不能为空";
        public final static String EQUIPMENT_ISNULL = "设备对象不能为空";
        public final static String UPDATA_BIND_VEHICLE = "设备绑定车辆失败";
        public final static String EQUPMENT_EXIST = "同一sim卡的设备在数据库中已存在";
    }
}
